'use strict';
// sort list:
var a=innerHTML = 'child'
// 测试:
;(function () {
    var
        arr, i,
        t = document.getElementById('test-list');
    if (t && t.children && t.children.length === 5) {
        arr = [];
        for (i=0; i<t.children.length; i++) {
            arr.push(t.children[i].innerText);
        }
        if (arr.toString() === ['Haskell', 'JavaScript', 'Python', 'Ruby', 'Scheme'].toString()) {
            console.log('测试通过!');
        }
        else {
            console.log('测试失败: ' + arr.toString());
        }
    }
    else {
        console.log('测试失败!');
    }
})();


//随机生成100以内的数并且带颜色：
let sz = document.getElementById('sz')
let coloraar = ['rad','green','blue','yellow','black']
for(let i = 1 ; i <= 100 ; i++){
    let p = document.createElement('p')
    p.innerText = i;
    let rndindex = parseInt(Math.random() * coloraar.length) + 1
    console.log(rndindex);
    p.style.backgroundColor = coloraar[rndindex]
    p.id = `p${i}`
    sz.appendChild(p)

    
}